#ifndef _SURFACEDIRECTDRAW_H_
#define _SURFACEDIRECTDRAW_H_

#include "YGSurface.h"

#include "SourcesDirectDraw.h"

namespace YoghurtGum
{

	class SurfaceDirectDraw : public Surface
	{

		friend class SurfaceDirectDraw;

	public:

		SurfaceDirectDraw(int a_Width, int a_Height, uint32 a_Flags = YG_SURFACE_DEFAULT);
		~SurfaceDirectDraw();

		void Fill(Color a_Color);

		bool DumpTo(Surface* a_Target);
		bool CopyTo(Surface* a_Target, int a_X, int a_Y);
		bool Draw(int a_X, int a_Y);

		void Line(float a_FromX, float a_FromY, float a_ToX, float a_ToY, Color a_Color);
			
		YGC* GetBuffer();
		void SetBuffer(YGC* a_Buffer);

	private:

		void Init(int a_Width, int a_Height);
		void SetBuffer();

		YGC* m_Buffer;

		int m_BPP;
		uint32 m_Flags;
		RECT m_Dimensions;
		LPDIRECTDRAWSURFACE m_Surface;
		LPDIRECTDRAWCLIPPER m_Clipper;
		DDSURFACEDESC m_Settings;
		DDBLTFX m_ClearSettings;

	}; // class SurfaceDirectDraw

}; // namespace YoghurtGum

#endif